#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int N = 510;
int n, m, s, t;
int ans = 0;
bool flag = 0;
bool vis[N];
vector<int> g[N];
void dfs(int u)
{
    if (u == t)
    {
        ans++;
        return;
    }
    int sz = g[u].size();
    if (sz == 0)
    {
        if (u != t)
            flag = 1;
        return;
    }
    for (int i = 0; i < sz; i++)
    {
        int v = g[u][i];
        dfs(v);
    }
}
int main()
{
    cin >> n >> m;
    int x, y;
    for (int i = 1; i <= m; i++)
    {
        cin >> x >> y;
        g[x].push_back(y);
    }
    cin >> s >> t;
    dfs(s);
    printf("%d ", ans);
    if (flag)
        printf("No\n");
    else
        printf("Yes\n");
    return 0;
}
